import os

def is_js_buffer(view):
    fName = view.file_name()
    vSettings = view.settings()
    syntaxPath = vSettings.get('syntax')
    syntax = ""
    ext = ""

    if (fName != None): # file exists, pull syntax type from extension
        ext = os.path.splitext(fName)[1][1:]
    if(syntaxPath != None):
        syntax = os.path.splitext(syntaxPath)[0].split('/')[-1].lower()

    return ext in ['js', 'json'] or "javascript" in syntax or "json" in syntax
